package com.yylc.cscore.entity;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.util.Date;

/**
 * 客服Entity
 *
 * @author xiangnan
 * date 2018/4/26
 */
@Data
public class CustomerEntity {
    private int id;
    private String serviceId;    // 客服id
    private String serviceName;  // 客服名称
    private String password;     // 登录密码
    private int    grade;
    private int    status;
    private String memo;
    private Date gmtCreate;
    private Date gmtModified;

    public CustomerEntity trim() {

        if (StrUtil.isBlank(serviceId)) {
            serviceId = null;
        }
        if (StrUtil.isBlank(serviceName)) {
            serviceName = null;
        }
        if (StrUtil.isBlank(memo)) {
            memo = null;
        }

        return this;
    }

    public boolean isAdmin() {
        return grade > 0;
    }

}
